<?php

namespace app\api\controller;

use app\api\model\UserSearch;
use app\common\controller\Api;
use think\Config;

class Search  extends Api
{
    protected $noNeedLogin = ['popular'];
    protected $noNeedRight = ['*'];

    public function popular()
    {
        $popular=Config::get("site.popular");

        $data['popular']=explode(',',$popular);
        $this->success('',$data);
    }
    public function history()
    {
        $user= $this->auth;
        $UserSearch = new UserSearch();
        $where['user_id']=$user->id;
        $list=$UserSearch->where($where)->limit(7)->order('id desc')->select();
        $this->success('',$list);

    }
}
